package com.label.grade.controller;/**
 * @author zhf
 * @date 2023/7/7 10:58
 * @version 1.0
 */

import com.label.Config.Logger.LogAnnotation;
import com.label.Model.Common.ResponseBean;
import com.label.grade.service.ExtracurricularScoreSummaryService;
import com.label.grade.service.ExtracurricularSumCalcService;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.eclipse.jetty.http.HttpStatus;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author zhf
 * 项目：student
 * 描述：二课接口
 * @date 2023/7/7 10:58
 **/
@RestController
@CrossOrigin
@RequestMapping("/learninganalysis/extracurricular")
public class ExtracurricularController {



    @Resource
    private ExtracurricularSumCalcService extracurricularSumCalcService;


    @GetMapping("/getall")
    @LogAnnotation(module = "第二课堂模块", operator = "获取所有学生二课数据")
    @RequiresAuthentication
    public ResponseBean getAll(){
        return new ResponseBean(HttpStatus.OK_200,"查找成功！", extracurricularSumCalcService.getExtracurricularOverallScore());
    }

    @GetMapping("/getone")
    @LogAnnotation(module = "第二课堂模块", operator = "获取辅导员视角的一个学生的二课详细数据")
    @RequiresAuthentication
    public ResponseBean getOne(@RequestParam("studentCode") String studentCode){
        return new ResponseBean(HttpStatus.OK_200,"查找成功！",extracurricularSumCalcService.getExtracurricularScore(studentCode));
    }

    @GetMapping("/getstudetail")
    @LogAnnotation(module = "第二课堂模块", operator = "获取一个学生的二课详细数据")
    @RequiresAuthentication
    public ResponseBean getStuDetail(@RequestParam("studentCode") String studentCode){
        return new ResponseBean(HttpStatus.OK_200,"查找成功！",extracurricularSumCalcService.getExtracurricularDetail(studentCode));
    }




}
